if (SERVER) then

	AddCSLuaFile( "shared.lua" )
	SWEP.Weight				= 5
	SWEP.AutoSwitchTo		= false
	SWEP.AutoSwitchFrom		= false
	SWEP.HoldType			= "ar2"

end

if ( CLIENT ) then

	SWEP.ViewModelFOV		= 75
	
	SWEP.IconFont = "CSSelectIcons"
	
	SWEP.PrintName = "Steyr AUG"
	SWEP.Slot = 5
	SWEP.Slotpos = 0
	SWEP.IconLetter = "e"
	
	killicon.AddFont( "weapon_steyr_ar", "CSKillIcons", SWEP.IconLetter, Color( 255, 80, 0, 255 ) )

end

 SWEP.Base				= "tp_base"

 SWEP.Spawnable = true;
 SWEP.AdminSpawnable = true;

 SWEP.ViewModel			= "models/weapons/v_rif_aug.mdl"
 SWEP.WorldModel			= "models/weapons/w_rif_aug.mdl"

 SWEP.Primary.Sound			= Sound( "weapons/aug/aug-1.wav" )
 SWEP.Primary.Recoil			= 5.1
 SWEP.Primary.Damage			= 29
 SWEP.Primary.NumShots		      = 1
 SWEP.Primary.Cone			= 0.018
 SWEP.Primary.ClipSize              = 30
 SWEP.Primary.Delay			= 0.11
 SWEP.Primary.Automatic             = true
 SWEP.Primary.Ammo                  = "ar2"

 SWEP.Secondary.Clipsize            = -1;
 SWEP.Secondary.DefaultClip         = -1;
 SWEP.Secondary.Automatic           = false
 SWEP.Secondary.Ammo                = "none"; 
 SWEP.Secondary.Delay			= 0.5

 bZoomed = false

function SWEP:Holster()
	bZoomed = false
	if (SERVER) then
		self.Owner:SetFOV( 0, 0.35 )
	end
return true end
 
function SWEP:Think()
	if self.Weapon:Clip1() <= 2 then
		if bZoomed then
			if (SERVER) then
				self.Owner:SetFOV( 0, 0.35 )
				bZoomed = false
			end
		end
	end
end
 
function SWEP:Reload()
	self.Weapon:DefaultReload( ACT_VM_RELOAD );
	if bZoomed then
		bZoomed = false
		self.Weapon:EmitSound("weapons/zoom.wav")
		if (SERVER) then
			self.Owner:SetFOV( 0, 0.35 )
		end
	end
return true end
 
function SWEP:SecondaryAttack()

	if not bZoomed then 
 
		if (SERVER) then
			self.Weapon:GetOwner():SetFOV(45,0.35)
		end
		util.PrecacheSound("weapons/zoom.wav")
		self.Weapon:EmitSound("weapons/zoom.wav")

		bZoomed = true

	else 

		bZoomed = false
		if (SERVER) then
			self.Owner:SetFOV( 0, 0.35 )
		end
		util.PrecacheSound("weapons/zoom.wav")
		self.Weapon:EmitSound("weapons/zoom.wav")
		
	end
end

